<%@ page language="java" pageEncoding="UTF-8"%>

<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/runqianReport.tld" prefix="report" %>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<script type="text/javascript" src="${res_app}/js/report/irisReport.js"></script>
<script>
$(function(){
	var value="${param.v_rule_code}";
	$(":checkbox[name=rule_type]").each(function(){
		if(value==""){
			$(this).attr("checked",true);
		}
		
		if(value!=""&&(","+value+",").indexOf(","+$(this).val()+",")>=0){
			$(this).attr("checked",true);
		}
		
	});
	
	 $("#sel_stat_year option[value='']").remove(); //删除Select中索引值为0的Option(第一个) 
	 $("#order_type option[value='']").remove(); //删除Select中索引值为0的Option(第一个) 
	
	
});

</script>
<style type="text/css">
.scrollDivBody
			{
				overflow-x: auto;
				overflow-y: hidden;
				BACKGROUND-COLOR: #ffffff; 
				SCROLLBAR-FACE-COLOR: #CFDDF0; 
				SCROLLBAR-SHADOW-COLOR: #CFDDF0; 
				SCROLLBAR-3DLIGHT-COLOR: #CFDDF0; 
				SCROLLBAR-ARROW-COLOR: #CFDDF0;
			}
.input-line{
	BORDER-RIGHT: 1px solid #495172;
	PADDING-RIGHT: 1px;
	BORDER-TOP: 1px ridge #819AD2;
	PADDING-LEFT: 1px;
	FONT-SIZE: 9pt;
	PADDING-BOTTOM: 1px;
	BORDER-LEFT: 1px ridge #819AD2;
	COLOR: #0C2358;
	PADDING-TOP: 2px;
	BORDER-BOTTOM: 1px solid #495172;
	HEIGHT: 21px;
	BACKGROUND-COLOR: #FFFFFF;
	text-decoration:underline;
}

.queryCon input {
    background-color: #FFFFFF;
    border: 1px solid #A1C0DC;
    height: 17px;
}
.selectWidth{
	width:55px;
}
</style>


</head>
<body>
<cpt:helpTips key="rule_info" id="tipsId" ></cpt:helpTips>
<br/>
<div class="soBox">
		<div class="detail ico_search">
			<table>
				<tr>
					<td rowspan="3"><strong>检索条件：</strong></td>
					<td  align="right" width="140px">
					年度：<cpt:select id="sel_stat_year" className="selectWidth" key="stat_year" value="${empty param.flag ? param.v_stat_year : stat_year}" ></cpt:select>
					</td>
					<td >
					申请单位： <input type="text" name="org_name" disabled  style="width:230px;" class="required"  label="单位名称"  maxlength="50"
		           id="org_name" value="${param.v_org_name}">
		           <input type="button" class="button_02"  id="selectPsn2" style="height: 20px; padding: 1px;" value="清空" onclick="clearPsnFromSys();">
		           <input type="button" class="button_02"  id="selectPsn" style="height: 20px; padding: 1px;" value="检索" onclick="addPsnFromSys();">
		           </td>
				</tr>
				<tr>
					<td align="right" width="140px">选择检索规则：</td>
					<td >
          		    <cpt:checkbox key="rule_type" name="rule_type"  repeatColumn="2" style="border: 0px; padding: 0px; margin: 0px;"></cpt:checkbox>
					
					</td>
				</tr>
				
				
				
				<tr>
				<td width="140px">
					排序条件：<cpt:select id="order_type" className="order_type" key="order_type" value="${empty param.v_order? 'org_name' : param.v_order}" ></cpt:select>
				</td>
				<td  >
					
					<form method="post" id="submitForm">
						<input name="v_stat_year" id="v_stat_year" value="${param.v_stat_year}" type="hidden">
						<input name="v_org_code" id="v_org_code" value="${param.v_org_code}" type="hidden">
						<input name="v_org_name" id="v_org_name" value="${param.v_org_name}" type="hidden">
						<input name="v_order" id="v_order" value="${param.v_order}" type="hidden">
						<input name="v_rule_code" id="v_rule_code" value="" type="hidden">
						<input name="v_admin_org_code" id="v_admin_org_code" value="" type="hidden">		
						<input type='button' id='searchBt' class="button_an" value='查询' onclick="doSubmit()"/>
					</form>
				</td>
				</tr>
				
			</table>
		</div>
	</div>
	<div class="clear_h10"></div>
<c:if test="${empty stat_year}">
<div align="center">
<table >
<tr align="center">
<td align="center">
					<input type="button" class="button" value="存为Excel"
						onclick="detailForm_saveAsExcel()" />
</td>
</tr>
</table>
</div>

<table width="100%" align="center">
<tr>
<td align="center">
<!--  params="v_prp_code=${v_prp_code};v_org_code=${v_org_code};v_role_id=${v_role_id}"
	-->	
			
	<report:html name="detailForm" reportFileName="rule_list2_repeat.raq"
			width="-1"
			height="-1"
			funcBarLocation="boTh"
			functionBarColor="#fff5ee"
			funcBarFontSize="9pt"
			funcBarFontColor="blue"
			separator="&nbsp;&nbsp;"
			needSaveAsExcel="no"
			needSaveAsPdf="no"
			needSaveAsWord="no"
			needPrint="no"
			printLabel="打印"
			params="v_org_code=${param.v_org_code};v_admin_org_code=${param.v_admin_org_code};v_stat_year=${param.v_stat_year};v_order=${param.v_order};v_rule_code=${param.v_rule_code}"
			saveAsName="立项项目查重"
			needPageMark="no"
			firstPageLabel="<span class='pageinfo'>[首 &nbsp;页]</span>" 
			prevPageLabel="<span class='pageinfo'>上一页</span>" 
			nextPageLabel="<span class='pageinfo'>下一页</span>" 
			lastPageLabel="<span class='pageinfo'>[最后页]</span>"
			pageMarkLabel="<span class='pageinfo'>第{currPage}页 共{totalPage}页</span>"					
			displayNoLinkPageMark="yes"
		/>
	
</td>
</tr>
</table>
</c:if>
<br>
<script type="text/javascript">


function doSubmit(){
	
	$("#v_stat_year").val($("#sel_stat_year").val());
	$("#v_org_code").val($("#v_org_code").val());
	$("#v_admin_org_code").val("");
	$("#v_order").val($("#order_type").val());
	$("#v_org_name").val($("#org_name").val());
	var valueStr="";
	$(":checkbox[name=rule_type]:checked").each(function(){
		valueStr+=","+$(this).val();
	});
	if (valueStr != "") {
		valueStr = valueStr.substring(1);
	}
	$("#v_rule_code").val(valueStr);
	
	$("#submitForm").attr("action","${ctx}/prpapprove/list-rep-prp");
	$("#submitForm").submit();
}

function addPsnFromSys(){
	tb_show("检索单位", "${ctx}/orgmanage/verifyorg/org_selector_ds?flag=main&TB_iframe=true&height=270&width=740", false);
}

function clearPsnFromSys(){
	$("#v_org_code").val("");
	$("#org_name").val("");
	$("#v_org_name").val("");
}

function selectPsnCall(data){
	$("#org_name").val(data.objMap.name);
	$("#v_org_name").val(data.objMap.name);
	$("#v_org_code").val(data.objMap.org_code);
	tb_remove2();
}


</script>
</body>
</html>

